package com.example.mapper.article;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.domain.childer_articles;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Controller;

import java.util.List;

@Mapper
@Controller
public interface articlesQuery extends BaseMapper<childer_articles> {

    @Select("select * from childrens_articles where category = ${category}")
    public List<childer_articles> findBycategoey(int category);

    @Select("select * from childrens_articles where title like ${name} limit ${a},${b}")
    public List<childer_articles> findByName(String name,int a,int b);

    @Select("select * from childrens_articles where title like ${name}")
    public List<childer_articles> findByName(String name);

    @Select("select * from childrens_articles order by num Desc limit 0,5")
    public List<childer_articles> select();

    @Select("select * from childrens_articles where id=${id}")
    public List<childer_articles> selectbyid(int id);

    @Select("select * from childrens_articles where userid=${userid}")
    public List<childer_articles> selectbyuserid(String userid);

    @Select("select * from childrens_articles limit ${a},${b}")
    List<childer_articles> selectall(Integer a,Integer b);

    @Select("select count(*) from childrens_articles")
    public int allnumber();



}
